package Timesheet;

import oracle.adfmf.java.beans.PropertyChangeListener;
import oracle.adfmf.java.beans.PropertyChangeSupport;

public class TimesheetBean {
    // transaction data values
    private int currPeriodReportRowKey = 0;
    private int currDailyReportRowKey = 0;
    private int currDailyReportLineRowKey = 0;

    // icons
    private static final String ICON_NEW = "/images/01_core_new/drawable-mdpi/ic_action_new.png";
    private static final String ICON_EDIT = "/images/01_core_edit/drawable-mdpi/ic_action_edit.png";
    private static final String ICON_SEARCH = "/images/01_core_search/drawable-mdpi/ic_action_search.png";
    private static final String ICON_ACCEPT = "/images/01_core_accept/drawable-mdpi/ic_action_accept.png";
    private static final String ICON_SAVE = "/images/05_content_save/drawable-mdpi/ic_action_save.png";
    private static final String ICON_CLOUD = "/images/04_collections_cloud/drawable-mdpi/ic_action_cloud.png";
    private static final String ICON_SEND_NOW = "/images/06_social_send_now/drawable-mdpi/ic_action_send_now.png";
    private transient PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

    public String getIconCloud() {
        return ICON_CLOUD;
    }

    public String getIconSendNow() {
        return ICON_SEND_NOW;
    }

    public String getIconSave() {
        return ICON_SAVE;
    }

    public String getIconNew() {
        return ICON_NEW;
    }

    public String getIconEdit() {
        return ICON_EDIT;
    }

    public String getIconSearch() {
        return ICON_SEARCH;
    }

    public String getIconAccept() {
        return ICON_ACCEPT;
    }

    public TimesheetBean() {
        super();
    }

    public void resetCurrRowPointers() {
        this.setCurrPeriodReportRowKey(0);
        this.setCurrDailyReportRowKey(0);
        this.setCurrDailyReportLineRowKey(0);
    }

    public void setCurrPeriodReportRowKey(int currPeriodReportRowKey) {
        int oldCurrPdReportRowKey = this.currPeriodReportRowKey;
        this.currPeriodReportRowKey = currPeriodReportRowKey;
        propertyChangeSupport.firePropertyChange("currPeriodReportRowKey", oldCurrPdReportRowKey,
                                                 currPeriodReportRowKey);
    }

    public int getCurrPeriodReportRowKey() {
        return currPeriodReportRowKey;
    }

    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }

    public void setCurrDailyReportRowKey(int currDailyReportRowKey) {
        int oldCurrDailyReportRowKey = this.currDailyReportRowKey;
        this.currDailyReportRowKey = currDailyReportRowKey;
        propertyChangeSupport.firePropertyChange("currDailyReportRowKey", oldCurrDailyReportRowKey,
                                                 currDailyReportRowKey);
    }

    public int getCurrDailyReportRowKey() {
        return currDailyReportRowKey;
    }

    public void setCurrDailyReportLineRowKey(int currDailyReportLineRowKey) {
        int oldCurrDailyReportLineRowKey = this.currDailyReportLineRowKey;
        this.currDailyReportLineRowKey = currDailyReportLineRowKey;
        propertyChangeSupport.firePropertyChange("currDailyReportLineRowKey", oldCurrDailyReportLineRowKey,
                                                 currDailyReportLineRowKey);
    }

    public int getCurrDailyReportLineRowKey() {
        return currDailyReportLineRowKey;
    }
}
